home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / usr / share / doc / libgphoto2-2 / linux-hotplug / usbcam.group < prev    next >
Encoding:
Text File  |  2009-01-07  |  1.1 KB  |  36 lines

  1. #!/bin/bash
  2. # $Id: usbcam.group 9931 2007-01-24 20:54:57Z marcusmeissner $
  3. #
  4. # /etc/hotplug/usb/usbcam
  5. #
  6. # Sets up newly plugged in USB camera so that only members of the 
  7. # group
  8.  
  9. GROUP=camera
  10.  
  11. # can access it from user space. (Replace camera with the name of the
  12. # group you want to have access to the cameras.)
  13. #
  14. # Note that for this script to work, you'll need all of the following:
  15. # a) a line in the file /etc/hotplug/usermap that corresponds to the 
  16. #    camera you are using. You can get the correct lines for all cameras 
  17. #    supported by libgphoto2 by running
  18. #              $ print-camera-list usb-usermap usbcam
  19. # b) a group "camera" where all users allowed access to the
  20. #    camera are listed
  21. # c) a Linux kernel supporting hotplug and usbdevfs
  22. # d) the hotplug package (http://linux-hotplug.sourceforge.net/)
  23. #
  24. # In the usermap file, the first field "usb module" should be named 
  25. # "usbcam" like this script.
  26.  
  27. [ -z "${DEVICE}" ] && DEVICE="${DEVNAME}"
  28.  
  29. if [ "${ACTION}" = "add" ] && [ -e "${DEVICE}" ]
  30. then
  31.     chmod o-rwx "${DEVICE}"
  32.     chgrp "${GROUP}" "${DEVICE}"
  33.     chmod g+rw "${DEVICE}"
  34. fi
  35.